//
//  YMStationAnnotationIconView.m
//  iOS_movingAnnotation
//
//  Created by lantaiyuan on 2017/10/18.
//  Copyright © 2017年 yours. All rights reserved.
//
#import "YMStationAnnotationIconView.h"

#define kWidth  10.f
#define kHeight 10.f

@implementation YMStationAnnotationIconView

#pragma mark - Life Cycle

- (void)drawRect:(CGRect)rect{
    
    CGContextRef context = UIGraphicsGetCurrentContext();
    
    CGContextSetStrokeColorWithColor(context, [UIColor colorWithHexString:@"#5298ff"].CGColor);
    CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
    
    CGContextSetLineWidth(context, 1);
    CGContextAddArc(context, kWidth/2.0, kHeight/2.0, 4, 0, 2 * M_PI, 0);
    CGContextDrawPath(context, kCGPathFillStroke);
    
    [super drawRect:rect];
    
}

- (id)initWithAnnotation:(id<MAAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    self.centerOffset = CGPointMake(0, -kHeight/2.0);
    self.backgroundColor = [UIColor clearColor];
    if (self)
    {
        self.bounds = CGRectMake(0.f, 0.f, kWidth, kHeight);
    }
    
    return self;
}
@end
